import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'login',
    component: ()=>import('../views/Login.vue')
  },
  {
     path:'/layout',
     name:'layout',
     component:()=>import('../views/layout/Index.vue')

  },
  {
      path:'/sys',
      name:'sys',
      component:()=>import('../views/layout/Index.vue'),
       children:[
         {
            path:'user',
            name:'user',
            component:()=>import('../views/system/User.vue')
         }
       ]
  },

    {
        path:'/info',
        name:'info',
        component:()=>import('../views/layout/Index.vue'),
        children:[
            {
                path:'normal',
                name:'normal',
                component:()=>import('../views/info/Normal.vue')
            }
        ]
    },
    {
        path:'/salary',
        name:'salary',
        component:()=>import('../views/layout/Index.vue'),
        children:[
            {
                path:'normal',
                name:'nor',
                component:()=>import('../views/salary/Normal.vue')
            }
        ]
    },

  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
